package exp4;

public class Point extends exp2.Point {
    public Point() {
        super();
    }

    public Point(int x, int y) {
        super(x, y);
    }

    @Override
    public boolean equals(Object obj) {
        if (this == obj) return true;
        if (obj == null) return false;
        if (obj instanceof exp2.Point p) {
            return getX() == p.getX() && getY() == p.getY();
        } else {
            return false;
        }
    }

    @Override
    public String toString() {
        return "Point{" +
                "x=" + getX() +
                ", y=" + getY() +
                '}';
    }
}
